<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>API日志</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="-493827029">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "-493827029";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("apilog.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建API日志"
  			,"inport":"导入API日志"
  			,"update":"修改API日志"
  			,"detail":"API日志详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#apilogForm").form({
		"":function(){}
		,"srvApiLog.salId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApiLog.salClient":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvApiLog.salApi":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if($("#salApi option").length==0)
					return "调用API至少添加一项";
			}
		}
		,"srvApiLog.salParams":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "调用参数不能为空";
			}
			if(el.value.length>65535 && el.value.indexOf("[*]")==-1)
				return "调用参数最大长度为65535个字符";
		}
		,"srvApiLog.salReturn":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "返回数据不能为空";
			}
			if(el.value.length>65535 && el.value.indexOf("[*]")==-1)
				return "返回数据最大长度为65535个字符";
		}
		,"srvApiLog.salInvokeTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"srvApiLog.salStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvApiLog" id="apilogForm" name="apilogForm" target="jsoniframe" action="apilog.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写API日志相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("salId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salId"))))}}
	{{lz.set("salId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salId}}
	<dl lz:if="{{salId_editable||salId_readonly}}" class="salId hidden " major  ref="salId">
		<dt>编　　号:</dt>
		<dd lz:if="{{salId_editable}}" input="hidden">
			<lz:block lz:if="{{srvApiLog$salId}}">
				{{srvApiLog$salId}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salId}}">
			<input type="hidden" value="{{lz.htm(srvApiLog.salId)}}" name="srvApiLog.salId" id="salId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="salId">{{srvApiLog.salId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiLog.salId$||srvApiLog.salId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salId}}
	{{lz.set("salClient_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salClient"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salClient"))))}}
	{{lz.set("salClient_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salClient}}
	<dl lz:if="{{salClient_editable||salClient_readonly}}" class="salClient  " major  ref="salClient">
		<dt>调用应用:</dt>
		<dd lz:if="{{salClient_editable}}" input="query">
			<lz:block lz:if="{{srvApiLog$salClient}}">
				{{srvApiLog$salClient}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salClient}}">
		 			<input title="请输入API客户端客户端ID进行查询" class="combox narrow" action="/admin/api/apiclient.query.do?value={param}" type="text" id="salClient" name="srvApiLog.salClient" text="{{lz.html(srvApiLog.salClient$||srvApiLog.salClient)}}" value="{{lz.htm(srvApiLog.salClient)}}" />
		 			<a class="lookup" href="javascript:void(0);" onclick="if($.trim($('#salClient').val())==''){return;};window.href('/admin/api/apiclient.detail.html?key='+$('#salClient').val())"></a>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salClient_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="salClient">{{srvApiLog.salClient}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/api/apiclient.details.html?key=srvApiLog.salClient}')">
			 {{lz.html(srvApiLog.salClient$||srvApiLog.salClient)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salClient}}
	{{lz.set("salApi_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salApi"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salApi"))))}}
	{{lz.set("salApi_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salApi}}
	<dl lz:if="{{salApi_editable||salApi_readonly}}" class="salApi   wider" major  ref="salApi">
		<dt>调用API:</dt>
		<dd lz:if="{{salApi_editable}}" input="list">
			<lz:block lz:if="{{srvApiLog$salApi}}">
				{{srvApiLog$salApi}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salApi}}">
		 	
		 		<input type="hidden" name="srvApiLog.salApi" value="0"/>
			    <div name="srvApiLog.salApi" id="salApi" class="wide input listinput">
					<div lz:for="{{srvApiLog.salApi$list}}">{{item.value}}<input type="hidden" name="srvApiLog.salApi" value="#{{item.key}}#"/><span onclick="$(this).parent().remove();">x</span></div>
				</div>
				<button type="button" style="float:left;" onclick="$.getInput({type:'combox',title:'API接口API名称',action:$(this).attr('action'),callback:function(id,text){$('#salApi').append('<div>'+text+'<input type=&quot;hidden&quot; name=&quot;srvApiLog.salApi&quot; value=&quot;'+id+'&quot;/><span onclick=&quot;$(this).parent().remove();&quot;>x</span></div>');}});" action="select * from srv_api where 1=1?value={param}" class="button def-add-button">添加</button>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salApi_readonly}}">
		 	<div class="state-input wide">
		 		<textarea class=""  style="display:none;" id="salApi">{{srvApiLog.salApi}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiLog.salApi$||srvApiLog.salApi)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salApi}}
	{{lz.set("salParams_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salParams"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salParams"))))}}
	{{lz.set("salParams_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salParams}}
	<dl lz:if="{{salParams_editable||salParams_readonly}}" class="salParams   wider" major  ref="salParams">
		<dt>调用参数:</dt>
		<dd lz:if="{{salParams_editable}}" input="textarea">
			<lz:block lz:if="{{srvApiLog$salParams}}">
				{{srvApiLog$salParams}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salParams}}">
		 	<textarea class="input wide"  id="salParams" name="srvApiLog.salParams" rows="5">{{srvApiLog.salParams}}</textarea>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入API日志的调用参数</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salParams_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApiLog.salParams$||srvApiLog.salParams)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salParams}}
	{{lz.set("salReturn_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salReturn"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salReturn"))))}}
	{{lz.set("salReturn_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salReturn}}
	<dl lz:if="{{salReturn_editable||salReturn_readonly}}" class="salReturn   wider" major  ref="salReturn">
		<dt>返回数据:</dt>
		<dd lz:if="{{salReturn_editable}}" input="textarea">
			<lz:block lz:if="{{srvApiLog$salReturn}}">
				{{srvApiLog$salReturn}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salReturn}}">
		 	<textarea class="input wide"  id="salReturn" name="srvApiLog.salReturn" rows="5">{{srvApiLog.salReturn}}</textarea>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入API日志的返回数据</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salReturn_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvApiLog.salReturn$||srvApiLog.salReturn)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salReturn}}
	{{lz.set("salInvokeTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salInvokeTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"salInvokeTime"))))}}
	{{lz.set("salInvokeTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salInvokeTime}}
	<dl lz:if="{{salInvokeTime_editable||salInvokeTime_readonly}}" class="salInvokeTime  " major  ref="salInvokeTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{salInvokeTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvApiLog$salInvokeTime}}">
				{{srvApiLog$salInvokeTime}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salInvokeTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvApiLog.salInvokeTime" id="salInvokeTime"  value="{{srvApiLog.salInvokeTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API日志的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salInvokeTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="salInvokeTime">{{srvApiLog.salInvokeTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiLog.salInvokeTime$||srvApiLog.salInvokeTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salInvokeTime}}
	{{lz.set("salStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"salStatus"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"salStatus"))))}}
	{{lz.set("salStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$salStatus}}
	<dl lz:if="{{salStatus_editable||salStatus_readonly}}" class="salStatus  " major  ref="salStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{salStatus_editable}}" input="select">
			<lz:block lz:if="{{srvApiLog$salStatus}}">
				{{srvApiLog$salStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvApiLog$salStatus}}">
		 	<select class="narrow" id="salStatus" name="srvApiLog.salStatus">
		 		<option value="">请选择</option>
				<option value="1" selected='{{srvApiLog.salStatus=="1"?"selected":""}}'>默认</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择API日志的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{salStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="salStatus">{{srvApiLog.salStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvApiLog.salStatus$||srvApiLog.salStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$salStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvApiLog.salId}}" name="srvApiLog.salId" id="salId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteApilog('{{srvApiLog.id}}','{{srvApiLog.salId}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/api/apilog.edit.html",document.title,"/admin//images/icons/20088256421631277809.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/api/apilog.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除API日志
	**/
	function deleteApilog(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除API日志",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/api/apilog.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>